﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AssociationTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //测试程序

            //DataClasses1DataContext context = new DataClasses1DataContext();
            //var customer = context.Customer.OrderBy(d => d.ID).First();
            //foreach (Purchase purchase in customer.Purchase)
            //{
            //    Console.WriteLine(purchase.Price);
            //}
            //Console.ReadLine();

            tempdbEntities aa = new tempdbEntities();
            var customer = aa.Customers.OrderBy(d => d.ID).First();
            foreach (Purchase purchase in customer.Purchases)
            {
                Console.WriteLine(purchase.Price);
            }
            Console.WriteLine(customer.ID);
            Console.ReadKey();
          
        }
    }
   


}
